interface Todo {
  title: string;
  completed: boolean;
  description: string;
  add(): number;
  del(): number;
  upt(): number;
}

type Test1 = "do";
type TestCap = Capitalize<Test1>;

// 获取Todo函数 Record<string, any>:类型约束为对象和数组
type Exc<T> = Exclude<T, Array<any>>;
type Degree<T extends Record<string, any>> = {
  // [P in keyof T as T[P] extends Function ? P : never]: T[P];
  [P in keyof Exc<T> as Exc<T>[P] extends Function
    ? `do${Capitalize<P & string>}`
    : never]: Exc<T>[P];
};

type Test = Degree<Array<any>>;

type Convert<T> = T extends any ? T : never;
type TestArrayKeys = Convert<keyof Array<any>>;
export {};
